# ui/main_window.py

import sys
from PyQt5.QtWidgets import QApplication, QStackedWidget
from community_viewer import CommunityViewer
from go_enrichment_viewer import GoEnrichmentViewer
from community_comparer import CommunityComparer


class MainWindow(QStackedWidget):
    def __init__(self):
        super().__init__()
        self.setWindowTitle("蛋白质复合物识别系统")
        self.setGeometry(100, 100, 1200, 800)

        # 添加各个页面
        self.community_viewer = CommunityViewer(self)
        self.go_viewer = GoEnrichmentViewer(self)
        self.comparison_viewer = CommunityComparer(self)

        self.addWidget(self.community_viewer)
        self.addWidget(self.go_viewer)
        self.addWidget(self.comparison_viewer)

        self.show()

    def switch_page(self, index):
        """切换到指定页面"""
        self.setCurrentIndex(index)


if __name__ == "__main__":
    app = QApplication(sys.argv)
    window = MainWindow()
    sys.exit(app.exec_())
